//
//  ChatSetUpFooterView.m
//  PigMarket
//
//  Created by mac on 2019/6/20.
//  Copyright © 2019 felix.pigmarket.oc. All rights reserved.
//

#import "ChatSetUpFooterView.h"


@interface ChatSetUpFooterView ()

/**
 线
 */
@property (nonatomic , strong) UIView *line;

@end
@implementation ChatSetUpFooterView

#pragma mark - init method
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initView];
        [self initLayout];
    }
    return self;
}

- (void)initView {
    // 添加子控件
    [self addSubview:self.clearBtn];
    [self addSubview:self.line];
    [self addSubview:self.quitBtn];
}

- (void)initLayout {
    // 布局子控件
    [self.clearBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.mas_equalTo(0);
        make.height.mas_equalTo(56);
    }];
    [self.line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.clearBtn.mas_bottom);
        make.left.right.mas_equalTo(0);
        make.height.mas_equalTo(1);
    }];
    [self.quitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.mas_equalTo(0);
        make.top.mas_equalTo(self.line.mas_bottom);
    }];
}
#pragma mark - getter and setter
- (UIButton *)clearBtn {
    if (!_clearBtn) {
        _clearBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_clearBtn setTitle:@"清空聊天记录" forState:UIControlStateNormal];
        [_clearBtn setTitleColor:[UIColor colorWithHexString:@"#EE5B5B"] forState:UIControlStateNormal];
        _clearBtn.titleLabel.font = [UIFont systemFontOfSize:16];
        _clearBtn.backgroundColor = [UIColor whiteColor];
    }
    return _clearBtn;
}
- (UIButton *)quitBtn {
    if (!_quitBtn) {
        _quitBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_quitBtn setTitleColor:[UIColor colorWithHexString:@"#EE5B5B"] forState:UIControlStateNormal];
        _quitBtn.titleLabel.font = [UIFont systemFontOfSize:16];
        _quitBtn.backgroundColor = [UIColor whiteColor];
    }
    return _quitBtn;
}
- (UIView *)line {
    if (!_line) {
        _line = [[UIView alloc] init];
        _line.backgroundColor = [UIColor colorWithHexString:@"#F7F7F7"];
    }
    return _line;
}
@end
